package tanxin;

public class Solution_55 {
    public boolean canJump(int[] nums) {
        int maxRight = 0;
        for (int i = 0; i < nums.length - 1; i++) {
            maxRight = Math.max(maxRight, nums[i] + i);
            if (maxRight < i + 1) {
                return false;
            }
        }
        return true;
    }
}
